package com.sise.stuteaintersys.mapper;

import com.sise.stuteaintersys.bean.entity.Message;
import com.sise.stuteaintersys.bean.entity.MessageExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MessageMapper {
    int countByExample(MessageExample example);

    int deleteByExample(MessageExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Message record);

    int insertSelective(Message record);

//   / void insertMessage(Message message);

    List<Message> selectByExample(MessageExample example);

    Message selectByPrimaryKey(Integer id);
    /**
     *  返回该课程的所有的留言信息
     *
     *@param courseId 课程编号
     *@return List<Message> 留言列表
     *@date 2019/1/1
     *@time 22:52
     */
    @Select("select * from message where message.course_id=#{courseId}")
    List<Message> selectAllMessage(Integer courseId);

    int updateByExampleSelective(@Param("record") Message record, @Param("example") MessageExample example);

    int updateByExample(@Param("record") Message record, @Param("example") MessageExample example);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

}